﻿namespace Microsoft.AspNetCore.App
{
    public static class MapRoutingExtensions
    {
        public static void MapGet(this IEndpointRouteBuilder builder, string pattern, RequestDelegate request)
        {
            builder.DataSource.AddEndpoint(new Endpoint(pattern, request, new string[] { HttpMethod.Get }));
        }
      
        public static void MapPost(this IEndpointRouteBuilder builder, string pattern, RequestDelegate request)
        {
            builder.DataSource.AddEndpoint(new Endpoint(pattern, request, new string[] { HttpMethod.Post }));
        }
    }
}
